﻿using System;

namespace Utility
{
    public static class ConsoleHelper
    {
        public static void WriteLine(ConsoleColor background, ConsoleColor foreground, string message, params object[] args)
        {
            Write(background, foreground, message, args);
            Console.WriteLine();
        }

        public static void Write(ConsoleColor background, ConsoleColor foreground, string message, params object[] args)
        {
            var originalBackground = Console.BackgroundColor;
            var originalForeground = Console.ForegroundColor;

            Console.BackgroundColor = background;
            Console.ForegroundColor = foreground;

            Console.Write(message, args);

            Console.BackgroundColor = originalBackground;
            Console.ForegroundColor = originalForeground;
        }
    }
}
